package com.hua.api.core.framework.http.factory;

import java.util.Arrays;
import java.util.Map;

@SuppressWarnings("all")
public class URLFactory {

    public URLFactory() {
    }

    public static String genUrlForGet(String url, Map<String, String> params) {
        String str = concatParams(params);
        String basedUrl = url + "?" + str;
        return basedUrl;
    }

    private static String concatParams(Map<String, String> paramMap) {
        Object[] key_arr = paramMap.keySet().toArray();
        Arrays.sort(key_arr);
        String str = "";
        Object[] var3 = key_arr;
        int var4 = key_arr.length;

        for(int var5 = 0; var5 < var4; ++var5) {
            Object key = var3[var5];
            if (!key.equals("appSecret")) {
                String val = (String)paramMap.get(key);
                str = str + "&" + key + "=" + val;
            }
        }

        return str.replaceFirst("&", "");
    }
}
